package com.ruyuan2020.im.design.DecoratorPattern;

// 具体的装饰器类：添加牛奶
public class Milk extends BeverageDecorator {
    public Milk(Beverage beverage) {
        super(beverage); // 调用父类的构造函数，传递被装饰的对象
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Milk"; // 添加描述信息
    }

    @Override
    public double cost() {
        return beverage.cost() + 0.30; // 增加成本
    }
}